#ifndef __MOTOR_H__
#define __MOTOR_H__

#include"GPIO.h"
#include"STC8H_PWM.h"
#include"Switch.h"

typedef struct
{
    int8 LQ_Speed;//左前轮
    int8 LH_Speed;//左后轮
    int8 RQ_Speed;//右前轮
    int8 RH_Speed;//右后轮
}MotorSpeed;

typedef enum
{
    MODE_LEFT,MODE_MID,MODE_RIGHT
}MotorMode;
void Motor_Init();

void Motor_Forward(int8 speed,MotorMode mode);

void Motor_Backward(int8 speed,MotorMode mode);

void Motor_Left(u8 speed);//左转

void Motor_Right(u8 speed);//右转

void Motor_Translate(int8 speed,MotorMode mode);//左右平移

void Motor_Around(int8 speed,MotorMode mode);//左右原地旋转

void Motor_Move(int x,int y);

void Motor_Stop();

#endif